#ifndef _ROS_robot_msgs_DrivePosition_h
#define _ROS_robot_msgs_DrivePosition_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"

namespace robot_msgs
{

  class DrivePosition : public ros::Msg
  {
    public:
      typedef int8_t _mode_type;
      _mode_type mode;
      typedef int32_t _left_drivers_type;
      _left_drivers_type left_drivers;
      typedef int32_t _right_drivers_type;
      _right_drivers_type right_drivers;
      enum { MODE_SEARCH_L = 0    };
      enum { MODE_SEARCH_R = 1         };
      enum { MODE_MINUTE = 2      };
      enum { MODE_ANGLE = 3       };
      enum { MODE_BACKWARDS = 4 };
      enum { MODE_POSING = 5 };

    DrivePosition():
      mode(0),
      left_drivers(0),
      right_drivers(0)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      union {
        int8_t real;
        uint8_t base;
      } u_mode;
      u_mode.real = this->mode;
      *(outbuffer + offset + 0) = (u_mode.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->mode);
      union {
        int32_t real;
        uint32_t base;
      } u_left_drivers;
      u_left_drivers.real = this->left_drivers;
      *(outbuffer + offset + 0) = (u_left_drivers.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_left_drivers.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_left_drivers.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_left_drivers.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->left_drivers);
      union {
        int32_t real;
        uint32_t base;
      } u_right_drivers;
      u_right_drivers.real = this->right_drivers;
      *(outbuffer + offset + 0) = (u_right_drivers.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_right_drivers.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_right_drivers.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_right_drivers.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->right_drivers);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      union {
        int8_t real;
        uint8_t base;
      } u_mode;
      u_mode.base = 0;
      u_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->mode = u_mode.real;
      offset += sizeof(this->mode);
      union {
        int32_t real;
        uint32_t base;
      } u_left_drivers;
      u_left_drivers.base = 0;
      u_left_drivers.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_left_drivers.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_left_drivers.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_left_drivers.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->left_drivers = u_left_drivers.real;
      offset += sizeof(this->left_drivers);
      union {
        int32_t real;
        uint32_t base;
      } u_right_drivers;
      u_right_drivers.base = 0;
      u_right_drivers.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_right_drivers.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_right_drivers.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_right_drivers.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->right_drivers = u_right_drivers.real;
      offset += sizeof(this->right_drivers);
     return offset;
    }

    const char * getType(){ return "robot_msgs/DrivePosition"; };
    const char * getMD5(){ return "2a16a5a0d9221e1e9c4601267466ff3b"; };

  };

}
#endif